package com.sun.showcase.report;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sun.showcase.biz.basic.service.GroupInfoService;
import com.sun.showcase.client.domain.basic.GroupInfo;
import com.sun.showcase.client.query.basic.GroupInfoQuery;

@Component
public class GroupInfoReport {
	
	@Autowired
	private GroupInfoService groupInfoService;
	
	public List<GroupInfo> groupData(String dsName,String datasetName,Map<String,Object> parameters){
		GroupInfoQuery groupInfoQuery = new GroupInfoQuery();
		List<GroupInfo> res = new ArrayList<GroupInfo>();
		if(parameters.containsKey("id")) {
			groupInfoQuery.setId((String)parameters.get("id"));
			res.add(groupInfoService.get(groupInfoQuery));
		}
		return res;
	}
}
